﻿//**********************************************************
//Copyright(C)2010 By 波特商网公司 版权所有。
//
//文件名：LoadingPanel
//文件功能：数据加载效果公共组件
//
//创建标识：齐李平 || 2011-04-15
//
//修改标识：
//修改描述：
//**********************************************************
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Hmc.IM.Common.Properties;
using System.Drawing;

namespace Hmc.IM.Common.UserControls
{
    /// <summary>
    /// 数据加载效果公共组件
    /// </summary>
    public class LoadingPanel : Panel
    {
        //文本显示
        private Label label = new Label();
        //加载图片
        private PictureBox pictureBox = new PictureBox();

        /// <summary>
        /// 构造函数
        /// </summary>
        public LoadingPanel()
        {
            this.Width = 161;
            this.Height = 29;
            this.Anchor = AnchorStyles.None;
            this.BackColor = Color.Transparent;
            this.BackgroundImage = Resources.load_data_bg;
            pictureBox.Location = new Point(10, 5);
            pictureBox.Size = new System.Drawing.Size(20, 20);
            pictureBox.Image = (Image)Resources.loading.Clone();
            pictureBox.Parent = this;
            pictureBox.Show();

            label.Text = "加载中，请稍候......";
            label.Parent = this;
            label.ForeColor = Color.FromArgb(2, 83, 152);
            label.Location = new Point(40, 8);
            label.Show();
        }
        /// <summary>
        /// 析构函数
        /// </summary>
        ~LoadingPanel()
        {
            this.BackgroundImage.Dispose();
        }
    }
}
